package cn.rongdao.jrkabao.model.cashadvance;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.dao.UserDao;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/7/26
 */

public class InsertUserModel extends BaseKaMaoModel {

    public static InsertUserModel getInstance() {
        return getPresent(InsertUserModel.class);
    }

    public void execute(Observer<String> observer) {
        addParamStrings("phone", FRString.valueOf(UserDao.getInstance().getPhone()));
        Observable<String> observable = mServletApi.insertUser(mParams).map(new HttpFunction<String>());
        toSubscribe(observable, observer);
    }

}
